Sending Command Messages

The Microsoft Windows operating system provides two functions for sending command messages to devices and to query devices for error information: mciSendCommand_H60X4 and mciGetErrorStringY6KOFT. The mciSendCommand function sends a command message to an MCI device. The mciGetErrorString function returns the error string corresponding to an error number.

The mciSendCommand function returns zero if successful. If the function fails, the low-order word of the return value contains an error code. You can pass this error code to mciGetErrorString to get a text description of it.